import 'package:gold/generated/json/base/json_convert_content.dart';
import 'package:gold/model/shop_commission_model.dart';

ShopCommissionModel $ShopCommissionModelFromJson(Map<String, dynamic> json) {
  final ShopCommissionModel shopCommissionModel = ShopCommissionModel();
  final int? month = jsonConvert.convert<int>(json['month']);
  if (month != null) {
    shopCommissionModel.month = month;
  }
  final int? yesterday = jsonConvert.convert<int>(json['yesterday']);
  if (yesterday != null) {
    shopCommissionModel.yesterday = yesterday;
  }
  final int? today = jsonConvert.convert<int>(json['today']);
  if (today != null) {
    shopCommissionModel.today = today;
  }
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    shopCommissionModel.total = total;
  }
  return shopCommissionModel;
}

Map<String, dynamic> $ShopCommissionModelToJson(ShopCommissionModel entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['month'] = entity.month;
  data['yesterday'] = entity.yesterday;
  data['today'] = entity.today;
  data['total'] = entity.total;
  return data;
}

extension ShopCommissionModelExtension on ShopCommissionModel {
  ShopCommissionModel copyWith({
    int? month,
    int? yesterday,
    int? today,
    int? total,
  }) {
    return ShopCommissionModel()
      ..month = month ?? this.month
      ..yesterday = yesterday ?? this.yesterday
      ..today = today ?? this.today
      ..total = total ?? this.total;
  }
}